use typed_builder::TypedBuilder;
use uuid::Uuid;
// use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
#[derive(Serialize, Deserialize, Debug, TypedBuilder)]
// #[sea_orm(table_name = "userpost")]
pub struct UserPost {
    // #[serde(with = "uuid_as_binary")]
    // #[sea_orm(primary_key)]
    id: Uuid,
    // #[serde(with = "uuid_as_binary")]
    post_id: Uuid,
    // #[serde(with = "uuid_as_binary")]
    user_id: Uuid,
    original_url: String,
    read: bool,
    read_at: Option<OffsetDateTime>,
    favorite: bool,
    show_real_url: bool,
    show_alternative_url: bool
}
impl UserPost {
    pub fn original_url(&self) -> String {
        self.original_url.clone()
    }
    pub fn show_real_url(&self) -> bool {
        self.show_real_url
    }
    pub fn show_alternative_url(&self) -> bool {
        self.show_alternative_url
    }

    pub fn post_id(&self) -> Uuid {
        self.post_id
    }
    pub fn read(&self) -> bool {
        self.read
    }
    pub fn read_at(&self) -> Option<OffsetDateTime> {
        self.read_at
    }
    pub fn favorite(&self) -> bool {
        self.favorite
    }
    pub fn user_id(&self) -> Uuid {
        self.user_id
    }
    pub fn id(&self) -> Uuid {
        self.id
    }
}
// #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
// pub enum Relation {
// }
// impl ActiveModelBehavior for ActiveModel {}
